#ifndef CADWND_H_
#define CADWND_H_

#include <QWidget>
#include <QMutex>
#include <QLabel>

class CAdWnd : public QWidget
{
	Q_OBJECT

public:
	explicit CAdWnd(QWidget* parent = 0);
	~CAdWnd();

	void SetInterval(int32_t itl);
	void SetVersion(const QString& version);
	void SetFileList(QVector<QString> list);
	void ClearList();
	void AppendFile(QString filename);
    inline bool Active() { return list_.size() > 0 ? true : false; }

protected:
	QPixmap load_pixmap_from_file(const QString& filename);

	void mousePressEvent(QMouseEvent *event) override;
	void paintEvent(QPaintEvent *event) override;

Q_SIGNALS:
	void backToHome();

private:
	QList<QPixmap>	list_;
	QMutex			mutex_;
	int32_t			index_;
	QTimer*			timer_;
	QString			version_;
};

#endif // CADWND_H_
